<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script>
</head>
<body>

<div id="hd">
<hd-News hd="cms" color="red" :news="abs"></hd-News>
    <hr>
    <hd-News></hd-News>
</div>
<script type="text/x-template" id="hdnews">
    <div>
        <li v-for="(v,k) in news">

            {{v.content}}
            <button @click="del(k)">删除</button>
        </li>
    </div>
</script>
<script>

    var hdNews={
        template:'#hdnews',
        props:['hd','color','data','news'],
        data(){
            return {}
        },
        methods:{
            del(k){
                this.news.splice(k,1);
            }
        }
    }
    var app=new Vue({
        el:'#hd',
        components:{
            hdNews:hdNews
        },
        data:{
            abs:[
                {id:1,content:'1111'},
                {id:2,content:'222'},
                {id:3,content:'333'},
                {id:4,content:'666'},
            ]
        }
    })
</script>
</body>
</html>